crontab -e
30 09 * * * /opt/script/clearLog.sh



/opt/script/clearLog.sh ##内容如下：
################################################################################################
#!/bin/sh
# 这个文件逻辑是删除多余日志

logpath=/opt/script/clearLog.log

echo `date '+%F %T'` '>>>>>>>>>>>>>>>>>>>>begin clear log files<<<<<<<<<<<<<<<<<<<<' >> $logpath

find /usr/local/apache-skywalking-apm-bin/logs -mtime +30 -name "*.log*" -exec rm -rf {} \;
echo `date '+%F %T'` '>>>>>>>>>>>>>>>>>>>>clear apache-skywalking log files,done' >> $logpath


find /opt/logs/ -mtime +90 -name "*.log*" -exec rm -rf {} \;
echo `date '+%F %T'` '>>>>>>>>>>>>>>>>>>>>clear /opt/logs/ log files,done' >> $logpath

echo `date '+%F %T'` '>>>>>>>>>>>>>>>>>>>>all done<<<<<<<<<<<<<<<<<<<<' >> $logpath
################################################################################################
